<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />

<title>业务员管理 - 销售业绩管理系统</title>
<style type="text/css">
<!--
.STYLE1 {	color: #FFFFFF;
	font-weight: bold;
	font-size: 12px;
}
.STYLE6 {font-size: 12px; }
.STYLE7 {font-size: 12px; background-color: #f5f5f5;margin:0;}
body { 
margin:0;
}
.STYLE8 {color: #FF0000}
-->
</style>
</head>

<body margin=0>

<table width="100%" bgcolor="#FFFFFF"  border="0" cellpadding="0" cellspacing="0">
  <tr>
    <td height="28" class="STYLE7">业务员管理 &gt;业务员信息提交</td>
  </tr>
  <tr>
    <td valign="top"><table width="50%" align="center" >
      <tr>
        <td height="25" colspan="2" bordercolor="#000000" bgcolor="#1C94C4"><div align="center" class="STYLE1">业务员信息创建</div></td>
      </tr>
	  <tr>
        <td height="25" bgcolor="#f5f5f5"><div align="right" class="STYLE6">
          <div align="left">&nbsp;上级业务员名称：</div>
        </div></td>
		  <td height="25" bgcolor="#F0F0F0"><span class="STYLE6">
		  	<input id="sjywyid" type="hidden"></input>
		    <input id="sjywy"  type="text"  disabled="disabled" value="无" size="15"/> <a href="#" onclick="showUsers()"><input type="submit" name="Submit2" value="选择业务员名称" /></a>
		  </span></td>
	  </tr>
      <tr>
        <td height="25" bgcolor="#f5f5f5"><div align="right" class="STYLE6">
          <div align="left">&nbsp;业务员名称：</div>
        </div></td>
		  <td height="25" bgcolor="#F0F0F0"><span class="STYLE6">
		    <input id="ywy" name="textfield3" type="text"  />
		    <span class="STYLE8">*</span></span></td>
			</tr>
			<tr>
        <td height="25" bgcolor="#f5f5f5"><div align="right" class="STYLE6">
          <div align="left">&nbsp;业务员编号：</div>
        </div></td>
		  <td height="25" bgcolor="#F0F0F0"><span class="STYLE6">
		    <input id="ywybh" name="textfield3" type="text"  />
		    <span class="STYLE8">*</span></span></td>
			</tr>
	 <tr>
        <td height="25" bgcolor="#f5f5f5"><div align="right" class="STYLE6">
          <div align="left">&nbsp;位置分布：</div>
        </div></td>
        <td height="25" bgcolor="#f5f5f5"><select id="wzfb" name="select">
			<option selected="selected">根</option>
          <option >左</option>
          <option>右</option>
        
        </select>
        </td>
	  </tr>
	  	 <!--   <tr>
        <td height="25" bgcolor="#f5f5f5"><div align="right" class="STYLE6">
          <div align="left">&nbsp;业务员分类：</div>
        </div></td>
        <td height="25" bgcolor="#f5f5f5"><select id="ywyfl" name="select">
          <option >专职业务员</option>
          <option selected="selected">美容院兼业务员</option>
        
        </select>        </td>
	  </tr> -->
	  <tr>
        <td height="25" bgcolor="#f5f5f5"><div align="right" class="STYLE6">
          <div align="left">&nbsp;初始核销左积分：</div>
        </div></td>
        <td height="25" bgcolor="#f5f5f5"><span class="STYLE6">
          <input id="zuohxjf" name="textfield4" type="text" size="10" value="0"/>
        </span></td>
      </tr>
      <tr>
        <td height="25" bgcolor="#f5f5f5"><div align="right" class="STYLE6">
          <div align="left">&nbsp;初始核销右积分：</div>
        </div></td>
        <td height="25" bgcolor="#f5f5f5"><span class="STYLE6">
          <input id="youhxjf" name="textfield4" type="text" size="10" value="0"/>
        </span></td>
      </tr>
      <!--  <tr>
        <td height="25" bgcolor="#f5f5f5"><div align="right" class="STYLE6">
          <div align="left">&nbsp;首30套发放奖金：</div>
         
        </div></td>
        <td height="25" bgcolor="#f5f5f5"><span class="STYLE6">
          <input id="first10" type="checkbox" style="margin-left:20px;" checked="checked"></input>
        </span></td>
      </tr> -->
	  <tr>
        <td height="25" bgcolor="#f5f5f5"><div align="right" class="STYLE6">
          <div align="left">&nbsp;地址：</div>
        </div></td>
        <td height="25" bgcolor="#f5f5f5"><span class="STYLE6">
          <input id="address" type="text" name="textfield" />
        <span class="STYLE8">*</span></span></td>
      </tr>
      <tr>
        <td height="25" bgcolor="#f5f5f5"><div align="right" class="STYLE6">
          <div align="left">&nbsp;所属城市：</div>
        </div></td>
        <td height="25" bgcolor="#f5f5f5"><select id="cities" name="select"></select>
         </td>
      </tr>
	  
      <tr>
        <td height="25" bgcolor="#f5f5f5"><div align="right" class="STYLE6">
          <div align="left">&nbsp;联系电话：</div>
        </div></td>
        <td height="25" bgcolor="#f5f5f5"><input id="telphone" name="textfield222" /><span class="STYLE8">*</span></td>
      </tr>
       <tr>
        <td height="25" bgcolor="#f5f5f5"><div align="right" class="STYLE6">
          <div align="left">&nbsp;银行卡号：</div>
        </div></td>
        <td height="25" bgcolor="#f5f5f5"><input id="banknum" name="banknum" /></td>
      </tr>
	  <tr>
        <td height="25" bgcolor="#f5f5f5"><div align="right" class="STYLE6">
          <div align="left">&nbsp;备注：</div>
        </div></td>
        <td height="25" bgcolor="#f5f5f5"><textarea id="bz" name="textarea" rows="5"></textarea></td>
	  </tr>
      <tr>
        <td height="25" colspan="2" bgcolor="#1C94C4"><div align="center" class="STYLE6">
            <form action="" method="post" name="form1" id="form1">
              <label>
              <input type="button" name="Submit" value="创 建"  onclick="winalert()"/>
              </label>
            </form>
        </div></td>
      </tr>
    </table></td>
  </tr>
</table>
<script type="text/javascript" src="../js/jquery-1.11.1.min.js"></script>
<script language="javascript">
$.get("../user/fetchcities",{},function(json){
	var opStr = "";
	for(var i = 0,l = json.length ; i < l ; i++)
	{
		opStr += "<option>" + json[i].CityName + "</option>";
	}
	$("#cities").empty().append(opStr);
});
function winalert(){
	var ywy = $("#ywy").val();
	var ywybh = $("#ywybh").val();
	var address = $("#address").val();
	var telphone = $("#telphone").val();
	if(ywy == null || ywy == ""){
		alert("请填写业务员姓名！");
		return;
	}
	if(ywybh == null || ywybh == ""){
		alert("请填写业务员编号！");
		return;
	}
	if(address == null || address == ""){
		alert("请填写业务员地址！");
		return;
	}
	if(telphone == null || telphone == ""){
		alert("请填写业务员电话！");
		return;
	}
	$.post("../ywy/add",{
		sjywyid:$("#sjywyid").val(),
		sjywy:$("#sjywy").val(),
		ywy:$("#ywy").val(),
		ywybh:$("#ywybh").val(),
		wzfb:$("#wzfb").val(),
		//ywyfl:$("#ywyfl").val(),
		zuohxjf:$("#zuohxjf").val(),
		youhxjf:$("#youhxjf").val(),
		//zuohxjf:0,
		//youhxjf:0,
		address:$("#address").val(),
		cities:$("#cities").val(),
		telphone:$("#telphone").val(),
		banknum:$("#banknum").val(),
		//first10:$("#first10").prop("checked"),
		bz:$("#bz").val(),
	},function(json){
		alert("添加成功！");
	});
}
function showUsers(){
	var value = showModalDialog('VerificationUsers.html','选择业务员','dialogWidth:500px;dialogHeight:600px; dialogLeft:200px;dialogTop:150px;center:yes;help:yes;resizable:yes;status:yes'); 
	var ywy = value.split(",");
	$("#sjywyid").prop("value",ywy[0]);
	$("#sjywy").prop("value",ywy[1]);
	$.get("../ywy/ywychild",{id:ywy[0]},function(json){
		if(!json)
			{
				$("#wzfb").prop("disabled","disabled");
				$("#wzfb").prop("value","左");
			}
	});
}
</script>
</body>
</html>
